package ua.kpi.flats.dao;

import java.util.List;

import org.hibernate.criterion.DetachedCriteria;

import ua.kpi.flats.entity.BuyApplication;
import ua.kpi.flats.entity.District;
import ua.kpi.flats.entity.Flat;
import ua.kpi.flats.entity.SaleApplication;
import ua.kpi.flats.entity.SuitableOption;

public interface ApplicationDao {
	List<District> getDistricts();
	void addBuy(BuyApplication app);
	void addSale(SaleApplication app);
	void addFlat(Flat flat);
	List<BuyApplication> getBuyApplications(int from,int limit);
	long buyAppCount();
	List<SaleApplication> getSaleApplications(int from, int limit);
	long saleAppCount();
	BuyApplication getBuyApp(long id);
	SaleApplication getSaleApp(long id);
	void removeBuyApp(BuyApplication app);
	void removeSaleApp(SaleApplication app);
	List<BuyApplication> waitingApps(DetachedCriteria criteria, int from, int limit);
	long getWaitingAppsCount(DetachedCriteria criteria);
	List<SuitableOption> getOptions(long appId);
	List<BuyApplication> getActiveBuyApp(DetachedCriteria criteria, int from,int limit);
	long activeAppCount(DetachedCriteria criteria);
	SaleApplication getSaleAppByOption(long optionId);
}
